#include <iostream>
using namespace std;
 
class A
{
public:
    A(int j):i(j)
    {
        fun1();
    }
    ~A()
    {
    }
 
    virtual void fun2()
    {
        i++;
    }
    void fun1()
    {
        i *= 10;
    }
    int i;
};
 
class B:public A
{
public:
    B(int j):A(j)
    {
        fun2();
    }
    ~B()
    {
    }
 
    void fun2()
    {
        i += 2;
    }
    void fun1()
    {
        i *= 100;
    }
};
 
int main()
{
    A* p = new B(1);
    cout<<p->i<<endl;
    delete p;
};
